const {
    Random
} = require("mockjs")
const Mock = require("mockjs")
const Tourism = require("../model/Tourism")


//创建数据的函数
async function tourismData(owenerId) {
    //酒店列表数据
    const {
        tourismList
    } = Mock.mock({
        "tourismList|20": [{
            'goodsId': '@id',
            'owenerId': owenerId,
            'city': '@county(true)' + " @cword(10)",
            'title|5-10': '@cword',
            'visitor|2-8': 0,
            'picUrl': Random.image("300x200", "#50B347", "#FFF", "@word(10)"),
            'tite|1': [
                ["近公交站", "可以做饭", "江景房"],
                ["近商圈", "可以停车"],
                ["可以唱歌", "提供早餐", "近景点", "近地铁站"],
                ["江景房", "提供早餐", "近地铁站"],
                ["江景房", "提供早餐", "近地铁站"],
                ["近公交站", "近景点", "可以停车"],
                ["可以停车", "可以唱歌", "有麻将桌", "近商圈"],
            ],
            'offical|20-40': '@cword',
            'score|2-5': 0,
            'likeygoodNum|10-1000':0
        }]
    })
    const res = await Promise.all(
        tourismList.map((item) => {
            // console.log(item);
            return Tourism.create(item)
        })
    )
}


module.exports = tourismData